From: Florian Müllner Date: Tue, 26 Jan 2021 10:33:54 +0000 (+0100) Subject: appDisplay: Handle dropped app favorites X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~567 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=55439713f40485f5d7fd60ee022d68f40569ccdb;p=gnome-shell.git appDisplay: Handle dropped app favorites Now that apps either appear in the dash or the app grid, it makes sense to allow DND between the two components to add and remove favorites. Currently this only works for adding items to the dash, update the app grid code to also accept drops from the dash. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index c891de966..6abe25e9b 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1325,7 +1325,8 @@ class AppDisplay extends BaseAppView { // exist in AppDisplay. We work around that by adding a placeholder // icon that is either destroyed on cancel, or becomes the effective // new icon when dropped. - if (_getViewFromIcon(source) instanceof FolderView) + if (_getViewFromIcon(source) instanceof FolderView || + this._appFavorites.isFavorite(source.id)) this._ensurePlaceholder(source); } @@ -1363,6 +1364,9 @@ class AppDisplay extends BaseAppView { if (this._currentDialog) this._currentDialog.popdown(); + if (this._appFavorites.isFavorite(source.id)) + this._appFavorites.removeFavorite(source.id); + return true; }